package com.mdd.common.mapper.order;

import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.order.RechargeOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 充值订单Mapper
 * @author panweiliang
 */
@Mapper
public interface RechargeOrderMapper extends IBaseMapper<RechargeOrder> {

    @Select({"SELECT COUNT(id) FROM ls_order WHERE pay_status = #{payStatus} AND delete_time IS NULL "})
    Long getRechargeOrderCountByPayStatus(Integer payStatus);

    @Select({"SELECT SUM(order_amount) FROM ls_order WHERE pay_status = 1 AND delete_time IS NULL "})
    BigDecimal getRechargeAmount();

}
